import request from "../../services/index"
import { IResponse, NoticeListResult } from "../../types/common";
import { NoticeInfoParams, NoticeListParams, Notification } from "../../types/notice"


export async function getNoticeInfo(params: NoticeInfoParams) {
    return request.get<IResponse<Notification>>('/api/notice/detail', params);
}

export async function getNoticeList(params: NoticeListParams) {
    return request.get<IResponse<NoticeListResult>>('/api/notice/list', params);
}
// 标记通知已读
export async function markNoticeRead(n_id: number) {
    return request.get<IResponse<void>>('/api/notice/mark_notice', { n_id });
}
// 发送新通知
export async function sendNotice(params: Notification) {
    return request.post<IResponse<void>>('/api/notice/send_notice', params);
}